/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.yixiang.co
* 注意：
* 本软件为www.yixiang.co开发研制，未经购买不得使用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package co.yixiang.modules.grandmaster.service.mapper;

import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.grandmaster.domain.YxGrandmaster;
import co.yixiang.modules.grandmaster.service.dto.YxGrandmasterPage;
import co.yixiang.modules.grandmaster.service.dto.YxGrandmasterQueryCriteria;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author hupeng
* @date 2021-08-12
*/
@Repository
public interface YxGrandmasterMapper extends CoreMapper<YxGrandmaster> {


    @Select("<script> SELECT\n" +
            "\tyg.*\n" +
            "FROM\n" +
            "\tyx_grandmaster yg\n" +
            "WHERE\n" +
            "\t1 = 1\n" +
            "ORDER BY\n" +
            "\tyg.create_time DESC </script> ")
    Page<YxGrandmasterPage> getGrandmasterPage(@Param("page") Page page1);

    @Select("<script> select yg.* from yx_grandmaster yg where 1=1 <if test = \"nickname !=null\"> and yg.nickname LIKE CONCAT('%',#{nickname},'%')</if> ORDER BY yg.create_time DESC </script>")
    List<YxGrandmaster> queryAll(YxGrandmasterQueryCriteria criteria);


}
